﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>method_1.html</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="../js/jquery-1.8.2.js"></script>
  </head>
  <body>
  
  	
  
  	<script type="text/javascript">
  		
  		//创建div元素，添加"哈哈"文本，ID属性，并添加到文档中
  		//<body><div id="2015">哈哈</div></body>
  		
  		/*js方式
  		var divElement = document.createElement("div");
  		divElement.innerHTML = "哈哈哈";
  		divElement.setAttribute("id","2015");
  		divElement.id = "2015";
		document.body.appendChild(divElement);*/
		  		
  		//jquery方式
  		var $div = $("<div id='2015'>哈哈哈哈哈</div>");
  		//$("body").append( $div );	
  		$(document.body).append( $div );	
  			
  	</script>
  
  </body>
</html>




